home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_elevswitch3.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  79 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_ElevSwitch3.cog
  4. #
  5. # This elevator will go up to frame one, sleep, then come back down to frame 0 when
  6. # entered from the bottom.  When entered from the top, it should stay at the bottom.
  7. # The button surface is a call switch you can put at the top to call the thing up there.
  8. # Elevator will react to "blocked" message.
  9. #
  10. # [DS/IS/JS]
  11. #
  12. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  13. # ========================================================================================
  14.  
  15. symbols
  16.     message    crossed
  17.     message    activate
  18.     message    arrived
  19.     message    timer
  20.  
  21.     surface    lower_adjoin0    linkid=1
  22.     surface    lower_adjoin1    linkid=1
  23.     surface    lower_adjoin2    linkid=1
  24.     surface    button            linkid=1
  25.  
  26.     thing        elevator                desc=elevator_object
  27.  
  28.     flex        start_wait=0.25    desc=pause_before_moving_up
  29.     flex        sleeptime=2.0
  30.     flex        speed=4.0
  31.  
  32. #    sound        wav0=beep1.wav
  33. end
  34.  
  35. # ========================================================================================
  36.  
  37. code
  38. crossed:                        // If player crosses adjoin(s)
  39.     Sleep(start_wait);                // pause before moving up
  40.     // fall through
  41.  
  42. # ........................................................................................
  43.  
  44. activate:                        // If player presses button
  45.     if (GetSenderId() != 1) return;
  46.     if (GetWallCel(button) == 1) return;
  47.  
  48.     SetWallCel(button, 1);
  49.     // PlaySoundPos(wav0, GetSurfaceCenter(button), 1, -1, -1, 0);
  50.     
  51.     MoveToFrame(elevator, 1, speed);
  52.     return;
  53.     
  54. # ........................................................................................
  55.  
  56. arrived:
  57.     if (GetCurFrame(elevator) == 0)
  58.     {
  59.         SetWallCel(button, 0);
  60.         // PlaySoundPos(wav0, GetSurfaceCenter(button), 0.75, -1, -1, 0);
  61.     }
  62.     else
  63.     {
  64.         // Set sleep time at top
  65.         SetTimer(sleeptime);
  66.     }
  67.     return;
  68.  
  69. # ........................................................................................
  70.  
  71. timer:
  72.     // Send elevator down
  73.     MoveToFrame(elevator, 0, speed);
  74.     return;
  75.     
  76. end
  77.  
  78.  
  79.